(defun yisp-hl-line-mode (s)
;;   (let ((do-hl (or (and s (boundp 'hl-line-mode) (not hl-line-mode))
;;                    (and (not s) (boundp 'hl-line-mode) hl-line-mode))))
;;     (hl-line-mode))
  (hl-line-mode s)
  )

(defun yisp-find-file-hook ()
  "Hook find-file."
  ;(interactive)

  ;; Enable truncate-lines 
  (if (not truncate-lines)
      (toggle-truncate-lines))

  ;; Using spaces for indent
  (setq indent-tabs-mode nil)

  (let ((c-style-name "gnu"))
    ;;(setq c-style-name "stroustrup")
    (cond

     ((or (string= "GNUmakefile" mode-name) ;;(eq 0 (string-match "[M|m|GNUm|GNUM]akefile" mode-name))
          (string= "GNUMakefile" mode-name)
          (string= "Makefile" mode-name)
          (string= "makefile" mode-name))
      ;; Disable indent-tabs-mode
      (setq indent-tabs-mode t)
      (message "indent-tabs-mode for Makefile enabled"))
     
     ((string= "C++/l" mode-name) ;;(string-match "^C++.*" mode-name);conflicts with CPerl
      (message mode-name)
      (setq tab-width 4)
      (c-set-style c-style-name)
      )
     
     ((string= "C/l" mode-name);;(string-match "^C.*" mode-name)
      (message mode-name)
      (c-set-style c-style-name)
      )
     
     (t (message "Unkown mode..."))))
  
  ;; Enable the hight-line mode
  (yisp-hl-line-mode t)

  ;; Enable linum-mode
  (linum-mode)

  t)

(defun yisp-compilation-hook ()
  "Hook compilation-mode."
  ;; Disable truncate-lines
  (if (not truncate-lines)
      (toggle-truncate-lines))
  ;; Enable hight-line mode
  (yisp-hl-line-mode t))

(defun yisp-dired-after-readin-hook ()
  (yisp-hl-line-mode t)
  (if (not truncate-lines)
      (toggle-truncate-lines)))

(add-hook 'find-file-hooks 'yisp-find-file-hook)
(add-hook 'compilation-mode-hook 'yisp-compilation-hook)
(add-hook 'dired-after-readin-hook 'yisp-dired-after-readin-hook)
